import {
	createRouter,
	createWebHashHistory
} from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'

const routes = [{
	path: '/home',
	name: 'home',
	component: Home,
	meta: {
		isShow: false,
	},
	children: [{
		path: '/courseList',
		name: 'CourseList',
		component: () => import('@/views/CourseList.vue'),
		meta: {
			isShow: true,
			title: '课程列表'
		}
	}, {
		path: '/teacherList',
		name: 'TeacherList',
		component: () => import('@/views/TeacherList.vue'),
		meta: {
			isShow: true,
			title: '教师列表'
		}
	}, {
		path: '/personal',
		name: 'Personal',
		component: () => import('@/views/Personal.vue'),
		meta: {
			isShow: true,
			title: '个人中心'
		}
	}]
}, {
	path: '/',
	name: 'login',
	component: Login,
	meta: {
		isShow: false,
	}
}]

const router = createRouter({
	history: createWebHashHistory(),
	routes
})

export default router